package com.smh.a03ConfigureFileDemo1;

import java.util.Map;
import java.util.Properties;
import java.util.Set;

public class Test1 {
    public static void main(String[] args) {

        //创建对象
        Properties pro = new Properties();

        //添加数据(一般只添加字符串)
        pro.put("asd", "123");
        pro.put("qwe", "123");
        pro.put("zxc", "123");
        pro.put("fgh", "123");

        System.out.println(pro);

        Set<Object> objects = pro.keySet();
        for (Object key : objects) {
            Object value = pro.get(key);
            System.out.println(key + "=" + value);
        }

        Set<Map.Entry<Object, Object>> entries = pro.entrySet();
        for (Map.Entry<Object, Object> entry : entries) {
            System.out.println(entry.getKey() + "=" + entry.getValue());
        }


    }
}
